<!doctype html>
<html class="no-js">
<head>
	<link rel="stylesheet" href="${rootPath}/assets/css/amazeui.min.css"/>
	<link rel="stylesheet" href="${rootPath}/assets/css/admin.css">
<script type="text/javascript" src="${rootPath}/ext/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${rootPath}/ext/js/jquery.md5.js"></script>
<script type="text/javascript">
//表单提交
function save(){
	if( $( "#name" ).val() == '' ) {
		window.parent.tips( "菜单名称,不能为空！" );
		return ;
	}
	var sysMenu = $("form").serialize();
	$.post( "${rootPath}/sys/menu/edit", sysMenu , function ( data ) {
			if ( data.status == 1 ) {
				window.parent.location.href="${rootPath}/sys/menu/";
			} else {
				window.top.tips( data.msg );
			}
	}, "json" );
}

</script>
</head>
<body>
<!-- content start -->
<div class="admin-content">
    <div class="am-cf am-padding">
      	<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">修改菜单</strong> / <small>Personal information</small></div>
    </div>
    <hr/>
    <div class="am-g">
		<form class="am-form am-form-horizontal">
			<input type="hidden" value="${sysMenu.id}" id="id" name="sysMenu.id">
			<div class="am-u-sm-12">	        
		        <div class="am-form-group">
		            <label for="parentName" class="am-u-sm-3 am-form-label">父级菜单</label>
		            <div class="am-u-sm-9">
		              	<input type="text" id="parentName" name="sysMenu.parentName" value="${sysMenu.parentName!'已是根目录'}" disabled="disabled" >
		            </div>
		        </div>

		        <div class="am-form-group">
		            <label for="name" class="am-u-sm-3 am-form-label">菜单名称</label>
		            <div class="am-u-sm-9">
		              	<input type="text" id="name" name="sysMenu.name" value="${sysMenu.name}" placeholder="输入菜单名称">
		            </div>
		        </div>
				
				<div class="am-form-group">
		            <label for="href" class="am-u-sm-3 am-form-label">菜单地址</label>
		            <div class="am-u-sm-9">
		              	<input type="text" name="sysMenu.href" value="${sysMenu.href}"  placeholder="填写菜单对应的菜单编号">
		            </div>
		        </div>
		        
				<div class="am-form-group">
		            <label for="icon" class="am-u-sm-3 am-form-label">菜单icon</label>
		            <div class="am-u-sm-9">
		            	<input type="hidden" name="sysMenu.icon" id="icon" value="${sysMenu.icon!'am-icon-file'}"  placeholder="请选择icon">
		              	<input type="hidden" id="icon-value" value="${sysMenu.icon!'am-icon-file'}">
		              	<a id="a_icon" class="${sysMenu.icon!'am-icon-file'}"></a>
		              	<a class="am-btn am-btn-sm am-btn-success" onclick="choseIco();">选择</a>
		              	<select data-am-selected="{btnSize: 'sm'}" onchange="selectStyle(this.value )" id="select-font">
		              		<option value=" " selected="selected">默认大小</option>
		              		<option value=" am-icon-sm">am-icon-sm</option>
		              		<option value=" am-icon-md">am-icon-md</option>
		              		<option value=" am-icon-lg">am-icon-lg</option>		              		
		              	</select>
		            </div>
		        </div>
		        
		        <div class="am-form-group">
		            <label for="description" class="am-u-sm-3 am-form-label">菜单描述</label>
		            <div class="am-u-sm-9">
		              	<textarea rows="2" cols="80" name="sysMenu.description"  placeholder="填写菜单对应的菜单编号">${sysMenu.description}</textarea>
		            </div>
		        </div>
		        
				<div class="am-form-group">
		            <label for="href" class="am-u-sm-3 am-form-label">菜单序号</label>
		            <div class="am-u-sm-9">
		              	<input type="text" name="sysMenu.sortNo" value="${sysMenu.sortNo}"  placeholder="菜单序号">
		            </div>
		        </div>
		        
		        <div class="am-form-group">
		            <label for="isUsed1" class="am-u-sm-3 am-form-label">是否有效</label>
		            <div class="am-u-sm-9">
		            	 <label class="am-radio-inline">
			                <input type="radio" value="1" ${sysMenu.isUsed==1?'checked="checked"':''} name="sysMenu.isUsed" > 正常
			            </label>
			            <label class="am-radio-inline">
			                <input type="radio" value="0" ${sysMenu.isUsed==0?'checked="checked"':''} name="sysMenu.isUsed"> 无效
			            </label>
		            </div>
		        </div>
		        
				<div class="am-form-group">
		            <label for="permission" class="am-u-sm-3 am-form-label">菜单权限类</label>
		            <div class="am-u-sm-9">
		              	<input type="text" name="sysMenu.permission" value="${sysMenu.permission}" placeholder="菜单权限类">
		            </div>
		        </div>
				

		         <div class="am-form-group">
		            <div class="am-u-sm-3 am-u-sm-push-3">
		              	<button type="button" onclick="history.go(-1);" class="am-btn am-btn-primary"><span class="am-icon-arrow-left"></span> 返回 </button>
		            </div>
		            
		            <div class="am-u-sm-6">
		              	<button type="button" onclick="save()" class="am-btn am-btn-primary"><span class="am-icon-save"></span> 保存 </button>
		            </div>
		        </div>
	      	</div>
	     </form>
    </div>
</div>
<!-- content end -->

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="${rootPath}/assets/js/polyfill/rem.min.js"></script>
<script src="${rootPath}/assets/js/polyfill/respond.min.js"></script>
<script src="${rootPath}/assets/js/amazeui.legacy.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="${rootPath}/assets/js/jquery.min.js"></script>
<script src="${rootPath}/assets/js/amazeui.min.js"></script>
<!--<![endif]-->
<script src="${rootPath}/assets/js/app.js"></script>
<script type="text/javascript">
	function choseIco(){
		window.top.choseIco();
	}	
	function selectStyle( value ){
		var clazz = $("#icon-value").val() +  value ;
		$("#a_icon").removeClass();
		$("#icon").removeClass();
		$("#a_icon").attr( "class" , clazz ) ;
		$("#icon").val( clazz ) ;
	}
	
	function setStyle( value ){
		$("#icon-value").val( value );
		var select = $("#select-font").val() ;
		$("#a_icon").removeClass();
		$("#icon").removeClass();
		$('#icon').val( value + select );
		$('#a_icon').attr( "class",value + select );
	}
</script>
</body>
</html>
